/*
 * 项目名称:    wms-server-jeecg
 * 创建人员:    hansen
 * 创建时间:    2023-09-25
 */
package org.jeecg.modules.dock.entity.mes.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.jeecg.modules.utils.DockContentUtil;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * MES-WMS发送叠片退料请求
 *
 * @author hansen
 * @version 1.0.0
 * @date 2023-09-25 08:26:52
 */
@ApiModel(value = "WMS发送叠片退料请求", description = "WMS发送叠片退料请求")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class LaminationReturnRequestVO extends MesBaseRequestVO {

    @NotNull
    @NotBlank
    @ApiModelProperty("生产订单号")
    private String orderCode;

    @NotNull
    @ApiModelProperty("台数")
    private Integer tableQuantity = 1;

    @NotNull
    @NotBlank
    @ApiModelProperty("原叫料任务")
    private String outboundTask;

    @NotNull
    @ApiModelProperty("明细")
    private List<Detail> detail;

    @Data
    public static class Detail implements Serializable {

        @NotNull
        @NotBlank
        @ApiModelProperty("物料编码")
        private String materialCode;

        @NotNull
        @NotBlank
        @ApiModelProperty("柱子批次号，长度10位")
        private String batchId;

        @NotNull
        @NotBlank
        @ApiModelProperty("位置，位置编号")
        private String position;

        @NotNull
        @NotBlank
        @ApiModelProperty("柱型(入“上轭AA”)")
        private String modelName;

        @ApiModelProperty("理料方向，1-正  ，2-反")
        private Integer direction;

        @NotNull
        @NotBlank
        @ApiModelProperty("台号，相同台号组成一台")
        private String tableCode;

        public void setMaterialCode(String materialCode) {
            this.materialCode = DockContentUtil.addZero(materialCode);
        }
    }
}
